package fun.chutianshu.competitionmanagement.service;

import fun.chutianshu.competitionmanagement.daomapper.StudentMapper;
import fun.chutianshu.competitionmanagement.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> getAllStudents() {
        return studentMapper.getAllStudent();
    }

    @Override
    public Student getOneStudent(int stuCode) {
        return studentMapper.getStudent(stuCode);
    }

    @Override
    public int updateStudent(Student student) {
        return studentMapper.updateStudent(student);
    }

    @Override
    public int addStudent(Student student) {
        return studentMapper.insertStudent(student);
    }

    @Override
    public int delStudent(int stuCode) {
        return studentMapper.deleteStudent(stuCode);
    }
}
